#pragma once
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include <map>

using namespace std;
class CXMLInstance
{
public:
	CXMLInstance(char* str_filename);
	~CXMLInstance(void);

public:
	xmlNodePtr	FindXmlNode(char* elementPath);

	WCHAR*	GetXmlElement(char* elementPath);
	char*	GetXmlElementChar(char* elementPath);
	WCHAR*	GetXmlElementWChar(char* elementPath);
	int		GetXmlElementInt(char* elementPath);
	double	GetXmlElementDouble(char* elementPath);

	BOOL	SetXmlElement(char* elementPath, char* value);
	BOOL	SetXmlElement(char* elementPath, WCHAR* valuew);
	BOOL	SetXmlElement(char* elementPath, int value);
	BOOL	SetXmlElement(char* elementPath, double value);
	BOOL	SaveXml();
#ifndef LINUX_NAS
	void	GetXmlElementList(char* elementPath, CMap<int, int, CString, CString> &map);
#else
	void	GetXmlElementList(char* elementPath, map<int, CString> &Map);
	BOOL	SetXmlElement(char* elementPath, const char* value);
	{
		SetXmlElement(elementPath, (char*)value);
	}
#endif

private:
	xmlDocPtr	xmlDoc;
	xmlNodePtr	rootNode;

	char	m_str_filename[MAX_PATH];

};
